﻿using System;
using System.Data;
using System.Data.Sql;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
using System.IO;

namespace TwiSQL
{
    public class TwiSQL
    {

        /// <summary>
        /// Tweets a message to a Twitter account.
        /// </summary>
        /// <param name="username">Twitter account name.</param>
        /// <param name="password">Twitter account password.</param>
        /// <param name="message">The message to post to the Twitter account.</param>
        [Microsoft.SqlServer.Server.SqlProcedure()]
        public static void Tweet(SqlString username, SqlString password, SqlString message)
        {
            SqlContext.Pipe.Send(Twitter.SendTweet(username.Value, password.Value, message.Value));
        }

    }

}